home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWString / SLStrRun.xh < prev    next >
Encoding:
Text File  |  1996-09-16  |  4.3 KB  |  188 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLStrRun.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  * 
  13.  *     File:        SLStrRun.idl
  14.  * 
  15.  *     Contains:    Interface for OTextRunReader and OTextRunWriter classes
  16.  * 
  17.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  18.  * 
  19.  * 
  20.  */
  21.  
  22.  
  23. #ifndef SOM_FW_OStringRunWriter_xh
  24. #define SOM_FW_OStringRunWriter_xh
  25.  
  26. class FW_OStringRunWriter;
  27.  
  28. #define FW_OStringRunWriter_MajorVersion 1
  29. #define FW_OStringRunWriter_MinorVersion 0
  30.  
  31. /*
  32.  * Passthru lines: File: "C.xh", "before"
  33.  */
  34.  
  35.  
  36. /* C++ SOM defs */
  37. #include <somcls.xh>
  38. #include <somcm.xh>
  39.  
  40. /* C++ parent defs */
  41. #ifndef SOM_FW_OTextRunWriter_xh
  42. #include <SLTxtRun.xh>
  43. #endif
  44.  
  45. #ifndef FW_OStringRunWriter_API
  46. #define FW_OStringRunWriter_API
  47. /*
  48.  * -- The Class API
  49.  */
  50.  
  51. /*
  52.  * Start of user-defined types:
  53.  */
  54. class SOMClass;
  55. class SOMObject;
  56. class FW_OTextRunReader;
  57. class FW_OTextRunWriter;
  58. class FW_OMemoryRunReader;
  59. class FW_OMemoryRunWriter;
  60. class FW_OStringRunWriter;
  61.  
  62. /*
  63.  * End of user-defined types.
  64.  */
  65.  
  66. #ifdef OLDIBMSOMAPISUPPORT
  67. #define FW_OStringRunWriterCClassData FW_OStringRunWriterClassData
  68. #define FW_OStringRunWriterNewClass(major,minor) somNewVersionedClassReference(FW_OStringRunWriter,major,minor)
  69. #endif
  70.  
  71. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  72. #define FW_OStringRunWriterMetaClass SOMClass
  73.  
  74. #if PRAGMA_ALIGN_SUPPORTED
  75. #  pragma options align=power
  76. #endif
  77.  
  78. /* The API to the FW_OStringRunWriter class object, and the methods it introduces. */
  79. SOMEXTERN struct FW_OStringRunWriterClassDataStructure {
  80. #ifdef OLDIBMSOMAPISUPPORT
  81.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  82. #else
  83.     long zero;
  84. #endif
  85.     somStaticClassInfo *sci;
  86.     somDToken        instanceDataToken;
  87.     long reserved [3];
  88.     somMToken somInit;
  89.     somMToken somUninit;
  90.     somMToken GetCurrentRun;
  91.     somMToken FlushRun;
  92.     somMToken NewRun;
  93.     somMToken Initialize;
  94.     somMToken GetLocale;
  95. } SOMDLINK FW_OStringRunWriterClassData;
  96.  
  97. #if PRAGMA_ALIGN_SUPPORTED
  98. #  pragma options align=reset
  99. #endif
  100.  
  101. #if !defined(FW_OStringRunWriter_Class_Source) && !defined(SOM_Module_slstrrun_Source)
  102. #if PRAGMA_IMPORT_SUPPORTED
  103. #pragma import list FW_OStringRunWriterClassData
  104. #endif
  105. #endif
  106.  
  107.  
  108. /*
  109.  * -- Typedefs and inline method declarations for left path inherited methods
  110.  * -- are omitted because this compilation had -museinheritedmethods in effect
  111.  */
  112.  
  113.  
  114. /*
  115.  * -- Typedefs for FW_OStringRunWriter Method Procedures
  116.  */
  117. SOMEXTERN {
  118. typedef FW_OStringRunWriter*   (* SOMLINK somTD_FW_OStringRunWriter_Initialize)(FW_OStringRunWriter *somSelf, Environment *ev,
  119.         FW_HString theString,
  120.         short bufferSize);
  121. }
  122.  
  123. #endif /* FW_OStringRunWriter_API */
  124.  
  125.  
  126. /*
  127.  * -- This emitter treats Method Tokens as Thunks by default.
  128.  * -- Use the sc modifier "nothunks" to change this default
  129.  */
  130. #undef somresolve_
  131. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  132.  
  133. /*
  134.  * -- The C++ Wrapper Class for FW_OStringRunWriter
  135.  */
  136. class FW_OStringRunWriter : public FW_OTextRunWriter
  137. {
  138. public:
  139.  
  140. // FW_OStringRunWriter::new registers use of the class object, and then uses somNew
  141. // to allocate memory and load the object method table pointer. 
  142. void *operator new(size_t size)
  143. {
  144.     SOM_IgnoreWarning(size);
  145.     // Allocate memory using the default allocator for FW_OStringRunWriter, and
  146.     // clear mem & set method table pointer, call basic initialization
  147. #ifdef SOMCHKNULL
  148.     void * __somResult = (void *)
  149.       somNewObject(FW_OStringRunWriter);
  150.     SOMCHKNULL(__somResult);
  151.     return __somResult;
  152. #else
  153.     return (void*) somNewObject(FW_OStringRunWriter);
  154. #endif
  155. }
  156.  
  157. // FW_OStringRunWriter::delete uses the default deallocator for the object's class.
  158. void operator delete(void * obj)
  159. {
  160.     if (obj) {
  161.         SOM_Resolve(obj,SOMObject,somFree)
  162.            ( (SOMObject*) obj );
  163.     }
  164. }
  165.  
  166. /* method: Initialize */
  167. FW_OStringRunWriter*   Initialize(Environment *ev,
  168.         FW_HString theString,
  169.         short bufferSize)
  170. {
  171.    #ifdef SOMCHKEXCEPT
  172.    FW_OStringRunWriter* __somResult = 
  173.       SOM_ResolveD(this,FW_OStringRunWriter,FW_OStringRunWriter,Initialize)
  174.     (this,ev,theString,bufferSize);
  175.       SOMCHKEXCEPT;
  176.    return __somResult;
  177. #else
  178.    return SOM_ResolveD(this,FW_OStringRunWriter,FW_OStringRunWriter,Initialize)
  179.     (this,ev,theString,bufferSize);
  180. #endif
  181. }
  182.  
  183. };   /* FW_OStringRunWriter */
  184.  
  185.  
  186.  
  187. #endif       /* SOM_FW_OStringRunWriter_xh */
  188.